<template>
	<view class="statisticsContainer">
		<view class="statisticsItem" v-for="(item,index) in signLog" :key="index">
			<view class="itemDay">
				<view class="">
					{{dayjs(item.time).format('MM-DD')}}
				</view>
				<view class="weekDay">
					{{week[dayjs(item.time).format('d')] }}
				</view>
			</view>
			<view class="signInfo">
				<view class="signTimeNo" v-for="(c,d) in item.signInList" :key="d"  >
					{{dayjs(c.time).format('HH:mm')}}
				</view>
				<view class="signTimeNo noSign" v-if='item.signInList.length===0'>
					今日无有效打卡信息
				</view>
				
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				signLog:[],
				week: ['周日','周一', '周二', '周三', '周四', '周五', '周六' ],
			};
		},
		onShow() {
			this.getList();
			
		},
		methods:{
			getList() {
				// [
				// 	{
				// 		time:`2024-06-${i> 10 ? i : '0'+i} 9:00`,
				// 	},
				// 	{
				// 		time:`2024-06-${i> 10 ? i : '0'+i} 18:00`,
				// 	}
				// ]
				const list = []
				for (var i = 1; i < 31; i++) {
					list.push({
						signType: i> 10 ? 1 : 2,
						time: `2024-06-${i> 10 ? i : '0'+i}`,
						range: '9:00-18:00',
						signInList:[],
						workTime: '8h'
					})
				}
				this.signLog = list
			}
		}
	}
</script>

<style lang="scss">
	
	.statisticsContainer{
		padding: 16px;
		
		.statisticsItem{
			display: flex;
			align-items: center;
			
			.itemDay{
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				font-size: 13px;
				.weekDay{
					font-size: 12px;
					color: #aaa;
				}
			}
			
			.signInfo{
				flex: 1;
				display: flex;
				align-items: center;
				margin-left: 16px;
				.signTimeNo{
					flex: 1;
					background-color: #e9e9e9;
					padding: 12px 0;
					text-align: center;
				}
				.signTimeNo + .signTimeNo{
					margin-left: 16px;
				}
				.noSign{
					font-size: 13px;
					color: #aaa;
				}
			}
			
			
		}
		.statisticsItem + .statisticsItem{
			margin-top: 24px;
		}
		
	}

</style>
